<%= error_messages_for :connection %>

<% form_for(:connection, :url => @connection.new_record? ? connections_path : connection_path(@connection), :html => { :method => @connection.new_record? ? :post : :put }) do |f| %>
  <p>
    <%= f.select :source_id, Actor.find(:all).collect { |a| [a.name, a.id] } %>
    is a 
    <%= f.select :tag, Connection::CONNECTIONS.map{|k,v| [k, k] } %>
    of 
    <%= f.select :target_id, Actor.find(:all).collect { |a| [a.name, a.id] }%>.
  </p>
  
  <h3>Description</h3>
  <p><%= f.text_area :description, :rows => 5, :cols => 78 %></p>
  
  <p>Created by <%= f.select :creator_id, User.find(:all).collect { |u| [u.name, u.id] }%>

  <p>
    <%= submit_tag @connection.new_record? ? "Create" : 'Update' %>
  </p>
<% end -%>
